/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.task.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.task.model.*;
import com.tech15.task.dao.*;
import com.tech15.task.service.*;
import com.tech15.task.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "TASK_RETURN")
public class TaskReturn extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "任务退回记录";
	public static final String ALIAS_TRID = "退回id";
	public static final String ALIAS_TASKID = "任务id";
	public static final String ALIAS_TPID = "任务处理id";
	public static final String ALIAS_THR = "退回人";
	public static final String ALIAS_SSLY = "申诉理由";
	public static final String ALIAS_SSSJ = "申诉时间";
	public static final String ALIAS_SSJG = "申诉结果";
	public static final String ALIAS_ZT = "状态(0处理中 1完成 2申诉失败)";
	public static final String ALIAS_SSR = "申诉人";
	public static final String ALIAS_THSJ = "退回时间";
	public static final String ALIAS_BZ = "部长";
	public static final String ALIAS_GG = "高管";
	public static final String ALIAS_CURCLR = "当前处理人";
	public static final String ALIAS_GBZSJ = "给部长时间";
	public static final String ALIAS_GGGSJ = "给高管时间";
	
	//date formats
	public static final String FORMAT_SSSJ = DATE_TIME_FORMAT;
	public static final String FORMAT_THSJ = DATE_TIME_FORMAT;
	public static final String FORMAT_GBZSJ = DATE_TIME_FORMAT;
	public static final String FORMAT_GGGSJ = DATE_TIME_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 退回id       db_column: TRID 
     */ 	
	
	private Long trid;
    /**
     * 任务id       db_column: TASKID 
     */ 	
	
	private Long taskid;
    /**
     * 任务处理id       db_column: TPID 
     */ 	
	
	private Long tpid;
    /**
     * 退回人       db_column: THR 
     */ 	
	
	private Long thr;
    /**
     * 申诉理由       db_column: SSLY 
     */ 	
	@Length(max=500)
	private java.lang.String ssly;
    /**
     * 申诉时间       db_column: SSSJ 
     */ 	
	
	private java.util.Date sssj;
    /**
     * 申诉结果       db_column: SSJG 
     */ 	
	@Length(max=500)
	private java.lang.String ssjg;
    /**
     * 状态(0处理中 1完成 2申诉失败)       db_column: ZT 
     */ 	
	@Max(127)
	private Integer zt;
    /**
     * 申诉人       db_column: SSR 
     */ 	
	
	private Long ssr;
	/**
     * 退回时间       db_column: THSJ 
     */ 	
	
	private java.util.Date thsj;
	/**
     * 部长       db_column: BZ 
     */ 
	private Long bz;
	/**
     * 高管       db_column: GG 
     */ 
	private Long gg;
	/**
     * 高管       db_column: CURLCLR 
     */ 
	private Long curclr;
	/**
     * 部长时间       db_column: GBZSJ 
     */ 	
	
	private java.util.Date gbzsj;
	/**
     * 高管时间       db_column: GGGSJ 
     */ 	
	
	private java.util.Date gggsj;
	
	//columns END


	public TaskReturn(){
	}

	public TaskReturn(
		Long trid
	){
		this.trid = trid;
	}

	

	public void setTrid(Long value) {
		this.trid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "TRID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getTrid() {
		return this.trid;
	}
	
	@Column(name = "TASKID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getTaskid() {
		return this.taskid;
	}
	
	public void setTaskid(Long value) {
		this.taskid = value;
	}
	
	@Column(name = "TPID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getTpid() {
		return this.tpid;
	}
	
	public void setTpid(Long value) {
		this.tpid = value;
	}
	
	@Column(name = "THR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getThr() {
		return this.thr;
	}
	
	public void setThr(Long value) {
		this.thr = value;
	}
	
	@Column(name = "SSLY", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getSsly() {
		return this.ssly;
	}
	
	public void setSsly(java.lang.String value) {
		this.ssly = value;
	}
	
	@Column(name = "BZ", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getBz() {
		return this.bz;
	}
	
	public void setBz(Long value) {
		this.bz = value;
	}
	
	@Column(name = "GG", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getGg() {
		return this.gg;
	}
	
	public void setGg(Long value) {
		this.gg = value;
	}
	
	@Column(name = "curclr", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getCurclr() {
		return this.curclr;
	}
	
	public void setCurclr(Long value) {
		this.curclr = value;
	}
	
	@Transient
	public String getSssjString() {
		return DateConvertUtils.format(getSssj(), FORMAT_SSSJ);
	}
	public void setSssjString(String value) {
		setSssj(DateConvertUtils.parse(value, FORMAT_SSSJ,java.util.Date.class));
	}
	
	@Column(name = "SSSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getSssj() {
		return this.sssj;
	}
	
	public void setSssj(java.util.Date value) {
		this.sssj = value;
	}
	
	@Column(name = "SSJG", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getSsjg() {
		return this.ssjg;
	}
	
	public void setSsjg(java.lang.String value) {
		this.ssjg = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getZt() {
		return this.zt;
	}
	
	public void setZt(Integer value) {
		this.zt = value;
	}
	
	@Column(name = "SSR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getSsr() {
		return this.ssr;
	}
	
	public void setSsr(Long value) {
		this.ssr = value;
	}
	
	@Transient
	public String getThsjString() {
		return DateConvertUtils.format(getThsj(), FORMAT_THSJ);
	}
	public void setThsjString(String value) {
		setThsj(DateConvertUtils.parse(value, FORMAT_THSJ,java.util.Date.class));
	}
	
	@Column(name = "THSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getThsj() {
		return this.thsj;
	}
	
	public void setThsj(java.util.Date value) {
		this.thsj = value;
	}
	
	@Transient
	public String getGbzsjString() {
		return DateConvertUtils.format(getGbzsj(), FORMAT_GBZSJ);
	}
	public void setGbzsjString(String value) {
		setGbzsj(DateConvertUtils.parse(value, FORMAT_GBZSJ,java.util.Date.class));
	}
	
	@Column(name = "GBZSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getGbzsj() {
		return this.gbzsj;
	}
	
	public void setGbzsj(java.util.Date value) {
		this.gbzsj = value;
	}
	
	@Transient
	public String getGggsjString() {
		return DateConvertUtils.format(getGggsj(), FORMAT_GGGSJ);
	}
	public void setGggsjString(String value) {
		setGggsj(DateConvertUtils.parse(value, FORMAT_GGGSJ,java.util.Date.class));
	}
	
	@Column(name = "GGGSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getGggsj() {
		return this.gggsj;
	}
	
	public void setGggsj(java.util.Date value) {
		this.gggsj = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Trid",getTrid())
			.append("Taskid",getTaskid())
			.append("Tpid",getTpid())
			.append("Thr",getThr())
			.append("Ssly",getSsly())
			.append("Sssj",getSssj())
			.append("Ssjg",getSsjg())
			.append("Zt",getZt())
			.append("Ssr",getSsr())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getTrid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof TaskReturn == false) return false;
		if(this == obj) return true;
		TaskReturn other = (TaskReturn)obj;
		return new EqualsBuilder()
			.append(getTrid(),other.getTrid())
			.isEquals();
	}
	
	private Long zrr;
	private String thrxm;
	private String ssrxm;
	private String title;
	private String bzxm;
	private String ggxm;
	
	@Transient
	public String getBzxm() {
		return bzxm;
	}

	public void setBzxm(String bzxm) {
		this.bzxm = bzxm;
	}

	@Transient
	public String getGgxm() {
		return ggxm;
	}

	public void setGgxm(String ggxm) {
		this.ggxm = ggxm;
	}

	@Transient
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Transient
	public String getSsrxm() {
		return ssrxm;
	}

	public void setSsrxm(String ssrxm) {
		this.ssrxm = ssrxm;
	}

	@Transient
	public String getThrxm() {
		return thrxm;
	}

	public void setThrxm(String thrxm) {
		this.thrxm = thrxm;
	}

	@Transient
	public Long getZrr() {
		return zrr;
	}

	public void setZrr(Long zrr) {
		this.zrr = zrr;
	}
	
}

